package edu.hrbu.spring.controller;

import edu.hrbu.spring.common.R;
import edu.hrbu.spring.service.DeptService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 徐登宇
 */
@RequestMapping("/rest")
@RestController
public class DeptRestController {

    @Resource(name = "deptServiceImpl")
    DeptService deptService;

    @GetMapping("/dept")
    public R getAllDepts(@RequestParam("page") int page, @RequestParam("size") int size) {
//        System.out.println(R.success(deptService.getAllDeptPage(page, size)));
        return R.success(deptService.getAllDeptPage(page, size));
    }


}
